function output = plotRevisitTime_output(IC,T,u,FN,CameraAngleCapability,TU)

options=odeset('RelTol',1e-13,'AbsTol',1e-13);

to = [0:0.01:T];
Xo = IC;
[t,S] = ode113(@(t,S)CR3BP_n(t,S,u),to,Xo,options);
S = S';
% plot3(S(1,:),S(2,:),S(3,:))
[row,col,~] = size(FN);
visibility=zeros(row,col,length(t));
revisitTime = zeros(row,col);
for ii = 1:row
    for jj = 1:col
        normvec = [FN(ii,jj,1);FN(ii,jj,2);FN(ii,jj,3)];
        for k = 1:length(t)
            posvec = S(1:3,k);
            angle_temp = acosd(dot(normvec,posvec)/(norm(normvec)*norm(posvec)));
            if angle_temp < CameraAngleCapability
                visibility(ii,jj,k) = 1;
            end
        end
        ind = find(visibility(ii,jj,:)==1);
        if isempty(ind)
            revisitTime(ii,jj) = 0;
            continue
        else
            revisitTime(ii,jj) = length(ind)*0.01*TU/3600/24;
        end
    end
end

output.northpole = max(revisitTime(1,:));
output.southpole = max(revisitTime(end,:));
end